/*
 * core_mqtt.h
 *
 *  Created on: 2021年9月22日
 *      Author: LF
 */

#ifndef SRC_MQTT_CORE_MQTT_H_
#define SRC_MQTT_CORE_MQTT_H_

#include "MQTTPacket.h"
#include "transport.h"

#define MQTT_KEEP_ALIVE_TIMEOUT_SECONDS		( 60U )


enum
{
	Qos0 = 0,
	Qos1,
	Qos2,
};

/*  mqtt 连接 broker  */
extern	int mqtt_connect(char *host, int port, char *clentid, char *username, char *passwd);

/*  断开连接  */
extern	int mqtt_disconnect(void);

/*  订阅主题  */
extern	int mqtt_subscribe_topic(char *topic, int qos, int msgid);

/*  取消订阅  */
extern	int mqtt_unsubscribe_topic(char *topic, int msgid);

/*  发布消息  */
extern	int mqtt_publish(char *topic, int qos, char *payload);

/*  保持心跳  */
extern	int mqtt_pingreq(void);






#endif /* SRC_MQTT_CORE_MQTT_H_ */
